/**
 * 
 */
package com.manage.action;

import java.util.List;

import org.apache.log4j.Logger;


import com.action.AbstractAction;
import com.manage.cache.SdkParamaterManager;
import com.manage.cache.SdkProvidersManager;
import com.manage.model.SdkParamater;
import com.manage.model.SdkProviders;


public class SdkParamaterAction extends AbstractAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Logger logger;
	
	public SdkParamaterAction()
	{
		logger = Logger.getLogger(this.getClass());
	}
	
	public String execute()
	{
		return SUCCESS;
	}

	private List<SdkParamater> list;
	private SdkParamater       model;
	private String        type;
	private SdkProviders sdkinfo;
	
	public String list()
	{
		logger.debug("list SdkParamaterAction");
		sdkinfo = SdkProvidersManager.getInstance().getSdkProviders(model.getSdkid());
		list = SdkParamaterManager.getInstance().getSdkParamaterBysdkid(model.getSdkid());
		return SUCCESS;
	}
	
	public String show()
	{
		sdkinfo = SdkProvidersManager.getInstance().getSdkProviders(model.getSdkid());
		if (model.getId() >= 0)
		{
			model = SdkParamaterManager.getInstance().getSdkParamater(model.getId());
			type = "update";
		}
		else
		{
			model.setId(-1);
			type = "insert";
		}

		return SUCCESS;
	}
	 
	public String save()
	{
		SdkParamaterManager.getInstance().saveSdkParamater(operator, type, model);
		return SUCCESS;
	}

	public List<SdkParamater> getList() {
		return list;
	}

	public void setList(List<SdkParamater> list) {
		this.list = list;
	}

	public SdkParamater getModel() {
		return model;
	}

	public void setModel(SdkParamater model) {
		this.model = model;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public SdkProviders getSdkinfo() {
		return sdkinfo;
	}

	public void setSdkinfo(SdkProviders sdkinfo) {
		this.sdkinfo = sdkinfo;
	}
	
	
}
